home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / dev / basic / PureBasic_Upd.lha / PureBasic_Update1.60 / PureBasic / Library SDK / PhxAss / MakeResident.asm < prev   
Encoding:
Assembly Source File  |  2000-09-10  |  3.0 KB  |  233 lines

  1. ;
  2. ; PhxAss macros definition for PureBasic libraries...
  3. ;
  4. ; 22/02/2000
  5. ;   Added EVEN to 'endfunc' (to prevent bugs...)
  6. ;
  7. ; 20/09/1999
  8. ;   Finished the work
  9. ;
  10. ; 19/09/1999
  11. ;   First version
  12. ;
  13.  
  14.  
  15.  INCLUDE "PureBasic:Library SDK/PhxAss/AmigaLibs.asm"
  16.  
  17. _ExecBase      = 1
  18. _GraphicsBase  = 2
  19. _IntuitionBase = 3
  20. _DosBase       = 4
  21.  
  22. byte     = 1
  23. word     = 1 << 1
  24. long     = 1 << 2
  25. llist    = 1 << 3
  26. listelem = 1 << 4
  27. array    = 1 << 5
  28. string   = 1 << 6
  29.  
  30.  
  31.  macro PB_BuildConstD
  32. d\1_b = \1 << 8 + byte
  33. d\1_w = \1 << 8 + word
  34. d\1_l = \1 << 8 + long
  35.  endm
  36.  
  37.  
  38.  macro PB_BuildConstA
  39. a\1_b = (\1+8) << 8 + byte
  40. a\1_w = (\1+8) << 8 + word
  41. a\1_l = (\1+8) << 8 + long
  42. a\1_list     = (\1+8) << 8 + llist
  43. a\1_listelem = (\1+8) << 8 + listelem
  44.  endm
  45.  
  46.  PB_BuildConstD 0
  47.  PB_BuildConstD 1
  48.  PB_BuildConstD 2
  49.  PB_BuildConstD 3
  50.  PB_BuildConstD 4
  51.  PB_BuildConstD 5
  52.  PB_BuildConstD 6
  53.  PB_BuildConstD 7
  54.  
  55.  PB_BuildConstA 0
  56.  PB_BuildConstA 1
  57.  PB_BuildConstA 2
  58.  PB_BuildConstA 3
  59.  PB_BuildConstA 4
  60.  PB_BuildConstA 5
  61.  PB_BuildConstA 6
  62.  PB_BuildConstA 7
  63.  
  64. d0 = 0
  65. d1 = 1
  66. d2 = 2
  67. d3 = 3
  68. d4 = 4
  69. d5 = 5
  70. d6 = 6
  71. d7 = 7
  72.  
  73. a0 = 8
  74. a1 = 9
  75. a2 = 10
  76. a3 = 11
  77. a4 = 12
  78. a5 = 13
  79. a6 = 14
  80. a7 = 15
  81.  
  82. ;
  83. ; Possible Flags:
  84. ; ---------------
  85. ;
  86.  
  87. NoBase       = 1
  88. InLine       = 1 << 1
  89. ByteResult   = 1 << 2
  90. LongResult   = 1 << 3
  91. StringResult = 1 << 4
  92.  
  93.  macro initlib
  94.   dc.l 'PBLI'
  95.   dc.l 1        ; Library ID (not used)
  96.   dc.b \1, 0    ; Name of the library
  97.   dc.b \2, 0    ; Filename of the helpfile of this lib
  98.   dc.b \3, 0    ; end function Name
  99.   Even
  100.   dc.w \4       ; Priority of the end call
  101.   dc.b \5, \6   ; Version, Revision (ie: V0.12)
  102.  endm
  103.  
  104.  
  105.  macro name
  106.   Dc.b \1, 0
  107.   Dc.b \2, 0
  108.   Even
  109.  endm
  110.  
  111.  
  112.  macro flags
  113.   IFGT NARG
  114.     Dc.b \1
  115.   ELSE
  116.     Dc.b 0
  117.   ENDIF
  118.  endm
  119.  
  120.  
  121.  macro amigalibs
  122.   Dc.b NARG/2     ; number of parameter of the macro/2
  123.  
  124.   IFGT NARG - 1   ; Equal to the line: 'IF NARG-1'
  125.     Dc.b \1, \2
  126.   ENDIF
  127.  
  128.   IFGT NARG - 3
  129.     Dc.b \3, \4
  130.   ENDIF
  131.  
  132.   IFGT NARG - 5
  133.     Dc.b \5, \6
  134.   ENDIF
  135.  
  136.   IFGT NARG - 7
  137.     Dc.b \7, \8
  138.   ENDIF
  139.  endm
  140.  
  141.  
  142.  macro params
  143.   Dc.w NARG                        ; Set NbArg number..
  144.  
  145.   IFGT NARG
  146.     Dc.w \1
  147.   ENDIF
  148.  
  149.   IFGT NARG - 1
  150.     Dc.w \2
  151.   ENDIF
  152.  
  153.   IFGT NARG - 2
  154.     Dc.w \3
  155.   ENDIF
  156.  
  157.   IFGT NARG - 3
  158.     Dc.w \4
  159.   ENDIF
  160.  
  161.   IFGT NARG - 4
  162.     Dc.w \5
  163.   ENDIF
  164.  
  165.   IFGT NARG - 5
  166.     Dc.w \6
  167.   ENDIF
  168.  
  169.   IFGT NARG - 6
  170.     Dc.w \7
  171.   ENDIF
  172.  
  173.   IFGT NARG - 7
  174.     Dc.w \8
  175.   ENDIF
  176.  endm
  177.  
  178.  
  179.  macro debugger  ; Number of the debugger routine
  180.   IFGT NARG-1
  181.     LEA.l _PB_StartDebuggerPart(pc),a0
  182.     LEA.l \2(pc),a0
  183.   ELSE
  184.     Dc.w 0,0
  185.     Dc.w 0,0
  186.   ENDIF
  187.  
  188.   LEA.l _PB_Label_FL_\1(pc),a0 ; Was NUMFUNC
  189.  endm
  190.  
  191.  
  192.  macro endfunc
  193.  EVEN
  194. _PB_Label_FL_\1:
  195.  endm
  196.  
  197.  
  198.  macro base
  199.   Dc.b "_P_",0
  200.   LEA.l _PB_BaseLabel(pc),a0
  201.  endm
  202.  
  203.  macro endlib
  204.   Even
  205. _PB_BaseLabel:
  206.  endm
  207.  
  208.  
  209.  macro startdebugger
  210.   LEA.l _PB_EndDebuggerPart(pc),a0
  211. _PB_StartDebuggerPart:
  212.  endm
  213.  
  214.  
  215.  macro enddebugger
  216.   Even
  217. _PB_EndDebuggerPart:
  218.   Dc.l "ENDG"
  219.  endm
  220.  
  221.  
  222.  macro debugerror
  223.   LEA.l   _PB_ErrorText\@,a0
  224.   MOVE.l   a0,16(a4)
  225.   MOVE.l   #8,4(a4)
  226.   RTS
  227.  
  228. _PB_ErrorText\@:
  229.  
  230.   Dc.b \1,0
  231.   Even
  232.  endm
  233.